Playing
Sounds Specified in the Registry
The PlaySound
To play a
sound event, call PlaySound with the pszSound parameter pointing
to a string containing the name of the registry entry that identifies the
sound. For example, to play the sound associated with the MouseClick entry
and to wait for the sound to complete before returning, use the following
statement:
PlaySound("MouseClick", NULL, SND_SYNC);
If the
specified registry entry or the waveform-audio file it identifies does not
exist, or if the file does not fit into the available memory, PlaySound
plays the default system sound.
The sound
events that are predefined by the system can vary with the platform. The
following list gives the sound events that are defined for all implementations
of the Win32 API:
SystemAsterisk |
SystemExclamation |
SystemExit |
SystemHand |
SystemQuestion |
SystemStart |
If an
application registers its own sound events, the user can configure the sound
event by using the standard Control Panel interface. The application should
register the sound event by using the standard registry functions; for more
information, see Registry
The sndPlaySound